<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>问答系统-用户登录</title>

    <!-- Bootstrap core CSS -->
    <link href="../css/bootstrap.css" rel="stylesheet">



    <!-- Custom styles for this template -->
    <link href="../css/signin.css" rel="stylesheet">

  </head>

  <body>

    <div class="container">

      <form class="form-signin" action="../us.do" method="post">
        <h2 class="form-signin-heading">请登录</h2>
        <input type="hidden" name="op" value="login" >
        <label for="userName" class="sr-only">用户名</label>
        <input type="text" id="userName" name="userName" class="form-control" placeholder="请输入用户名" required autofocus>
        <label for="userPwd" class="sr-only">密码</label>
        <input type="password" id="userPwd" name="userPwd" class="form-control" placeholder="请输入密码" required>
        <div class="checkbox">
          <label>
            <input type="checkbox" value="remember-me"> 记住我
          </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
      </form>
      ${msg}

    </div> <!-- /container -->
    <script type="text/javascript">
       var cookies = document.cookie;
       console.log(cookies);
       
       var cks = cookies.split(";");
       
       console.log(cks);
       
       for (var i = 0; i < cks.length; i++) {
		 console.log(cks[i].substr(cks[i].indexOf("=")+1));
	}
       
       /* document.getElementById("userName").value=cks[0].substr(cks[0].indexOf("=")+1);
       document.getElementById("userPwd").value=cks[1].substr(cks[1].indexOf("=")+1); */
       
       /*以上代码是临时的演示，不能直接项目中使用*/
    </script>
  
  </body>
</html>
